package com.android.powerbankpad.socket;

import android.os.Build;

import org.java_websocket.client.WebSocketClient;
import org.java_websocket.drafts.Draft_6455;
import org.java_websocket.handshake.ServerHandshake;

import java.net.URI;

import javax.net.ssl.SSLParameters;

public class PowerWebSocketClient extends WebSocketClient {
    public PowerWebSocketClient(URI serverUri) {
        super(serverUri, new Draft_6455());
    }

    @Override
    protected void onSetSSLParameters(SSLParameters sslParameters) {
        try {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
                super.onSetSSLParameters(sslParameters);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    public void onOpen(ServerHandshake handshakedata) {

    }

    @Override
    public void onMessage(String message) {

    }

    @Override
    public void onClose(int code, String reason, boolean remote) {

    }

    @Override
    public void onError(Exception ex) {

    }
}
